//
//  GlobalHeader.h
//  EraPig
//
//  Created by Mac_Mini on 2021/1/7.
//

#ifndef GlobalHeader_h
#define GlobalHeader_h

#import "GlobalFile.h"

#import "UIColor+MMAdd.h"
#import "UIView+MMAdd.h"
#import "NSString+MMAdd.h"

///暂不登录
#define Temporary_login @"Temporary_login"

static NSString *WXAppID = @"wx28c4e09291e3bc1c";
static NSString *WXAppSecret = @"590bbe95c3c8661cb89a438cfe6500c7";
//static NSString *WXAppID = @"wx09bbfd1367f8da12";
//static NSString *WXAppSecret = @"0fa58b11852f4cd38e046ade37f55513";


#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

///状态栏高度
#define StatusBarHeight        statusBarHeight()
#define BottomSpace            bottomSpace()
#define NavigationBarHeight    (self.navigationController.navigationBar.frame.size.height+StatusBarHeight)
#define NavigationBarHeightForView    (self.viewController.navigationController.navigationBar.frame.size.height+StatusBarHeight)
#define TabBarHeight           (self.tabBarController.tabBar.bounds.size.height)

#define kImageNamed(imageName) [UIImage imageNamed:imageName]
#define kNotificationCenter    [NSNotificationCenter defaultCenter]
#define kUserDefaults          [NSUserDefaults standardUserDefaults]
#define kURL(urlstr)           [NSURL URLWithString:[NSString stringByReplaceNullString:urlstr]]

static inline CGFloat statusBarHeight() {
    CGFloat statusBarHeight = 0;
    if (@available(iOS 13.0, *)) {
        statusBarHeight = [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame.size.height;
    } else {
        statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
    }
    return statusBarHeight;
}
static inline CGFloat bottomSpace() {
    CGFloat bottomSpace = 0;
    if (@available(iOS 11.0, *)) {
        bottomSpace = [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
    } else {
        // Fallback on earlier versions
    }
    return bottomSpace;
}
// 跳转方式类型
typedef NS_ENUM(NSInteger, JumpType) {
    JumpTypeWithPush,
    JumpTypeWithPresent,
};
/// 切换团长的通知key
static NSString *LEADER_DID_CHANGE_NOTIFICATION = @"LEADER_DID_CHANGE_NOTIFICATION";
/// 登录成功的通知key
static NSString *LOGIN_SUCCESSED_NOTIFICATION = @"LOGIN_SUCCESSED_NOTIFICATION";
/// 支付成功
static NSString *PaySuccessHandNotification = @"PaySuccessHandNotification";


#endif /* GlobalHeader_h */
